@import '../../assets/styles/variables.scss';

.index {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  padding-bottom: 50px;
  
  // 顶部大黄条
  &-topbar {
    background: #ffe600;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 20px 12px 20px;
    min-height: unset;
    position: relative;
    border-bottom: 1px solid #f0f0f0;
    
    &__left {
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      margin-bottom: 0;
    }
    .index-brand {
      font-size: 52px;
      font-weight: 900;
      color: #222;
      line-height: 1;
      letter-spacing: 0;
      margin-right: 0;
      font-family: inherit;
      font-style: italic;
    }
    .index-slogan {
      font-size: 26px;
      color: #999;
      margin-top: 0;
      font-weight: 800;
      letter-spacing: 0;
    }
    &__right {
      display: flex;
      align-items: flex-start;
      gap: 18px;
      margin-top: 2px;
    }
    &__icon {
      width: 52px;
      height: 52px;
      margin-left: 8px;
      display: flex;
      align-items: flex-end;
    }
  }
  
  &-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-top: 0;
    padding-bottom: 100px;
  }
  
  &-searchbar-area {
    flex: 0 0 auto;
    background: #ffe600;
    display: flex;
    align-items: flex-end;
    padding: 0 0 8px 0;
    margin-top: 0;
  }
  
  &-searchbar {
    width: 100%;
    display: flex;
    align-items: center;
    background: #ffe600;
    padding: 0 20px;
  }
  
  &-banner-area {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    .banner-swiper {
      height: 100% !important;
      min-height: 0;
    }
  }
  
  &-tags-area {
    flex: 0 0 100px;
    min-height: 0;
    display: flex;
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
  }
  
  &-tags {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
  }
  .index-tag {
    flex: 1;
    text-align: center;
    font-size: 25px;
    color: #333;
    font-weight: bold;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
    cursor: default;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  &-grid.product {
    flex: 0 0 220px;
    min-height: 0;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 0;
    margin-bottom: 0;
  }
  
  &-grid.service {
    flex: 0 0 220px;
    min-height: 0;
    background: #fff;
    border-bottom: none;
    padding: 0;
    margin-bottom: 0px;
  }
  
  .index-grid__item {
    flex: 1;
    max-width: 25%;
    padding: 0 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
  }
  
  .index-grid__icon {
    width: 76px;
    height: 76px;
    margin-bottom: 6px;
    border-radius: 50%;
    background: #f7f7f7;
    object-fit: cover;
    box-shadow: 0 2px 8px #eee;
    border: 1.5px solid #f5f5f5;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .index-grid__text {
    font-size: 15px;
    color: #333;
    text-align: center;
    font-weight: 700;
    letter-spacing: 1px;
  }
  
  // 轮播图
  &-banner {
    width: 100%;
    height: 200px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    margin-bottom: 8px;
    .index-banner__image {
      width: 100%;
      height: 100%;
      border-radius: 16px;
      object-fit: cover;
      margin: 0;
      box-shadow: 0 2px 8px rgba(0,0,0,0.04);
      display: block;
    }
  }
  
  // 分类区域
  &-category {
    padding: $spacing-md 0;
    background-color: $white;
    margin-bottom: $spacing-md;
    
    &__list {
      display: flex;
      flex-wrap: wrap;
    }
    
    &__item {
      width: 20%;
    }
  }
  
  // 标题栏
  &-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: $spacing-md;
    background-color: $white;
    
    &__text {
      font-size: $font-size-lg;
      font-weight: bold;
      color: $text-color-primary;
      position: relative;
      padding-left: $spacing-sm;
      
      &::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 4px;
        height: 16px;
        background-color: $primary-color;
        border-radius: $border-radius-sm;
      }
    }
    
    &__more {
      font-size: $font-size-sm;
      color: $text-color-secondary;
    }
  }
  
  // 产品列表
  &-products {
    background-color: $white;
    margin-bottom: $spacing-md;
    
    &__list {
      display: flex;
      flex-wrap: wrap;
      padding: 0 $spacing-xs;
    }
    
    &__item {
      width: 50%;
      padding: $spacing-xs;
      box-sizing: border-box;
    }
  }
  
  // 产品卡片
  &-product-card {
    border-radius: $border-radius-md;
    overflow: hidden;
    box-shadow: $shadow-sm;
    background-color: $white;
    
    &__image {
      width: 100%;
      height: 140px;
    }
    
    &__content {
      padding: $spacing-sm;
    }
    
    &__title {
      font-size: $font-size-md;
      color: $text-color-primary;
      margin-bottom: $spacing-xs;
      @extend .text-ellipsis-2 !optional;
      height: 40px;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }
    
    &__price {
      font-size: $font-size-lg;
      color: $primary-color;
      font-weight: bold;
      
      &-unit {
        font-size: $font-size-xs;
        font-weight: normal;
      }
    }
  }
}

.index-topbar__left-row {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 0;
  max-width: 80vw;
  flex-wrap: wrap;
}

.index-float-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 30px;
  margin: 0 auto;
  width: 94vw;
  max-width: 600px;
  min-width: 320px;
  background: #666;
  border-radius: 16px;
  display: flex;
  align-items: center;
  padding: 10px 16px;
  z-index: 999;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}
.float-bar-close {
  font-size: 28px;
  color: #ccc;
  margin-right: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.float-bar-text {
  color: #fff;
  font-size: 26px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.float-bar-action {
  margin-left: 16px;
  flex-shrink: 0;
}
.float-bar-btn {
  background: #ffe066;
  color: #333;
  font-size: 26px;
  font-weight: bold;
  border-radius: 8px;
  padding: 8px 22px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: background 0.2s;
}
.float-bar-btn:active {
  background: #ffd633;
}
